﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using CubaLibreBar.Win.Controles;
using CubaLibreBar.Win.Relatorios;
using CubaLibreBar.Win.Telas;

namespace CubaLibreBar.Win
{
    public partial class Principal : Form
    {
        public Principal()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            lbVersion.Text = string.Format("CubaLibreBar v.{0}", Assembly.GetEntryAssembly().GetName().Version.ToString());
        }

        private void ajudaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pnlPrincipal.Controls.Clear();
            pnlPrincipal.Controls.Add(new Ajuda());
        }

        private void estoqueToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pnlPrincipal.Controls.Clear();
            pnlPrincipal.Controls.Add(new Estoque());
        }

        private void vendasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pnlPrincipal.Controls.Clear();
            pnlPrincipal.Controls.Add(new CadastroVendas());
        }

        private void produtosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pnlPrincipal.Controls.Clear();
            pnlPrincipal.Controls.Add(new CadastroProduto());
        }

        private void logOutToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            this.Hide();
            Login login = new Login();
            login.Show();
        }

        private void alterarSenhaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AlterarSenha alterarSenha = new AlterarSenha();
            alterarSenha.Show();
        }

        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);

            Application.Exit();
        }

        private void fluxoDeCaixaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pnlPrincipal.Controls.Clear();
            pnlPrincipal.Controls.Add(new FluxoCaixa());
        }

        private void produtosToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            pnlPrincipal.Controls.Clear();
            pnlPrincipal.Controls.Add(new ProdutosCadastrados());
        }
    }
}
